@echo off
chcp 65001 > nul
setlocal enabledelayedexpansion

REM 获取当前分支名
for /f "tokens=*" %%i in ('git rev-parse --abbrev-ref HEAD') do set branch_name=%%i

REM 获取最新commit的短ID
for /f "tokens=*" %%i in ('git rev-parse --short HEAD') do set commit_id=%%i

REM 将信息写入文件
set content=%branch_name%@%commit_id%
echo %content% > VERSION.txt
echo 版本信息已写入VERSION.txt 🟢 %content%